package com.yanqu.road.server.cmd.activity.dragonboatrace;

import com.yanqu.road.pb.dragonboatrace.DragonBoatRaceProto;
import com.yanqu.road.server.cmd.CrossCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.manager.activity.dragonboatrace.DragonBoatRaceMgr;
import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.server.protocol.CrossProtocol;

/**
 * @Description
 * @Author cwq
 * @Data 2022/2/15 16:56
 */
@Cmd(code = CrossProtocol.C2_DRAGONBOATRACE_GET_DISTANCE_AND_RECEIVE_INFO, desc = "获取联盟航行距离和领取信息")
public class CrossDragonBoatRaceGetDistanceAndReceiveInfoCmd extends CrossCommand {

    int activityId;
    String unionId;

    @Override
    public boolean parseData(YanQuMessage packet) throws Exception {
        DragonBoatRaceProto.DragonBoatRaceTotalDistanceAndReceiveInfoGameToCrossMsg builder = DragonBoatRaceProto.DragonBoatRaceTotalDistanceAndReceiveInfoGameToCrossMsg.parseFrom(packet.getBytes());
        activityId = builder.getActivityId();
        unionId = builder.getUnionId();
        return true;
    }

    @Override
    public void execute(YanQuMessage packet) throws Exception {
        DragonBoatRaceMgr.getDistanceAndReceivedInfo(packet.getPlayerId(), serverId, activityId, unionId);
    }

    @Override
    public void sendData() {

    }
}
